<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <div id="test0"></div>
    <div id="test1"></div>
    <div id="test2"></div>
    <script src="../React-js/react.development.js" type="text/javascript"></script>
    <script src="../React-js/react-dom.development.js" type="text/javascript"></script>
    <script src="../React-js/babel.min.js" type="text/javascript"></script>
    <script type="text/babel">
         class Person extends React.Component{
            render(){
                const {name,sex,age} = this.props
                return (
                    <ul>
                        <li>姓名：{name}</li>
                        <li>性别：{sex}</li>
                        <li>年龄：{age}</li>
                    </ul>
                )
            }
        }
        ReactDOM.render(<Person name='Tom' sex='男' age={19}/>,document.querySelector('#test0'))
        ReactDOM.render(<Person name='Jerry' sex='女' age={18}/>,document.querySelector('#test1'))
        const p = {name:'Dog',sex:'男',age:19} // key value 相同可以简写
        ReactDOM.render(<Person {...p}/>,document.querySelector('#test2'))
    </script>
</body>
</html>